package com.adui.mgt.performance.service;

import com.adui.mgt.performance.common.Result;
import com.adui.mgt.performance.entity.Department;
import com.adui.mgt.performance.mapper.DepartmentMapper;
import com.adui.mgt.performance.service.base.impl.BaseServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.stereotype.Service;

@Service
public class DepartmentService extends BaseServiceImpl<DepartmentMapper, Department> {


    public Result findPage(Department department) {

        LambdaQueryWrapper<Department> queryWrappers = new LambdaQueryWrapper<>(department);
        return Result.data(this.page(new Page<>(department.getPageNum(), department.getPageSize()), queryWrappers));
    }
}
